package com.jucai.pppeiyouclient.adapter;

import android.content.Context;

import com.jucai.pppeiyouclient.R;
import com.jucai.pppeiyouclient.base.CommonRecyclerViewAdapter;
import com.jucai.pppeiyouclient.bean.CoinRecordBean;

import java.util.List;

/**
 * Created by Kuky on 2017-05-05.
 */

public class CoinRecordAdapter extends CommonRecyclerViewAdapter<CoinRecordBean> {

    public CoinRecordAdapter(Context context, List<CoinRecordBean> data) {
        super(context, data);
    }

    @Override
    public void bindHolder(CommonHolder holder, CoinRecordBean coinRecordBean) {
        holder.setText(R.id.record_name, coinRecordBean.getCredit_log_content());
        holder.setText(R.id.record_time, coinRecordBean.getCredit_log_time());
        if (coinRecordBean.getCredit_log_num().contains("-"))
            holder.setText(R.id.coin_no, coinRecordBean.getCredit_log_num() + "金币");
        else
            holder.setText(R.id.coin_no, "+" + coinRecordBean.getCredit_log_num() + "金币");
    }

    @Override
    protected int getItemType(int position) {
        return 0;
    }

    @Override
    public int getLayoutId(int viewType) {
        return R.layout.item_coin_layout;
    }
}
